import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import './assets/global.css'
import './assets/fonts/iconfont.css'
import axios from 'axios'
import ContentBox from './components/mycom/ContentBox.vue'

import TreeTable from 'vue-table-with-tree-grid'

Vue.config.productionTip = false
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
axios.interceptors.request.use(function(config){
  // 添加请求头的token
  config.headers.Authorization = window.sessionStorage.getItem('token')
  // 修改完之后 让请求发送出去
  return config
})

Vue.component("content-box",ContentBox)
Vue.component('tree-table',TreeTable)

Vue.prototype.$http = axios

// Vue.use 相当于 Vue.component
Vue.use(ElementUI)
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
